﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace order_project
{
    public class OrderDetail
    {
        public string ProductName { get; set; }
        public decimal UnitPrice { get; set; }
        public int Quantity { get; set; }

        public override bool Equals(object obj)
        {
            if (obj is OrderDetail detail)
            {
                return ProductName == detail.ProductName && UnitPrice == detail.UnitPrice && Quantity == detail.Quantity;
            }
            return false;
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(ProductName, UnitPrice, Quantity);
        }

        public override string ToString()
        {
            return $"Product: {ProductName}, Unit Price: {UnitPrice}, Quantity: {Quantity}";
        }
    }

}
